// SPDX-License-Identifier: Apache-2.0
package v1alpha1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// TenantModule represents a HelmRelease with the label internal.cozystack.io/tenantmodule=true
type TenantModule struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// AppVersion represents the version of the Helm chart
	AppVersion string `json:"appVersion,omitempty"`

	// Status contains the module status
	Status TenantModuleStatus `json:"status,omitempty"`
}

// TenantModuleStatus represents the status of a TenantModule
type TenantModuleStatus struct {
	// Version represents the last attempted revision
	Version string `json:"version,omitempty"`

	// Conditions represent the latest available observations of the module's state
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// TenantModuleList contains a list of TenantModule
type TenantModuleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []TenantModule `json:"items"`
}

// DeepCopy methods are generated by deepcopy-gen
